var t = require("../common/index.js");

require("../../../utils/image.js");
var app = getApp()
Component({
    properties: {
        data: { type: Object },
        floorIndex: { type: Number }
    },
    data:{imgurl:app.getImgUrl()},
    methods: {
        goLink: function(e) {
          console.log('getCurrentPages()', getCurrentPages())
            var o = e.currentTarget.dataset, i = o.type, a = o.positionIndex, n = o.timestamp, 
            r = e.currentTarget.offsetTop;
            var s = this.data.floorIndex;
            if ("goods" === i) {
                var p = e.currentTarget.dataset.item, d = p.id, m = p.activityId;
                if (!d) return;
                (0, t.goLink)({
                    type: "goods",
                    data: { item : p },
                    saOption: {
                        componentName: "actionList",
                        floorIndex: s,
                        positionIndex: a,
                        timestamp: n,
                        offsetTop: r
                    }
                });
            } else if ("page" === i) {
                var c = e.currentTarget.dataset.link;
                (0, t.goLink)({
                    type: "page",
                    data: { item: p },
                    saOption: {
                        componentName: "actionList",
                        floorIndex: s,
                        positionIndex: a,
                        timestamp: n,
                        offsetTop: r
                    }
                });
            }
        }
    }
});